package edu.polsl.bio.str.common.entity;

import edu.polsl.bio.str.common.constant.JobStatus;

import javax.persistence.*;
import java.util.Date;

/**
 * //todo class description
 * <p/>
 * Created on: Jun 13, 2011 6:34:31 PM <br/>
 * <a href="http://www.polsl.pl">www.polsl.pl</a>
 *
 * @author lukasz.olczak@polsl.pl
 */
@Entity
@Table(name = "jobs")
public class Job extends BaseEntity {

  private JobStatus status;

  private Date startProcessing;

  private Date endProcessing;

  private Integer refStart;

  private Integer refEnd;

  private Integer queryStart;

  private Integer queryEnd;

  private Long jobGroupId;

  private Node node;

  private String dataFilePath;

  @Enumerated(EnumType.STRING)
  @Column(name = "status", nullable = false)
  public JobStatus getStatus() {
    return status;
  }

  public void setStatus(JobStatus status) {
    this.status = status;
  }

  @Column(name = "start_processing")
  public Date getStartProcessing() {
    return startProcessing;
  }

  public void setStartProcessing(Date startProcessing) {
    this.startProcessing = startProcessing;
  }

  @Column(name = "end_processing")
  public Date getEndProcessing() {
    return endProcessing;
  }

  public void setEndProcessing(Date endProcessing) {
    this.endProcessing = endProcessing;
  }

  @Column(name = "ref_start")
  public Integer getRefStart() {
    return refStart;
  }

  public void setRefStart(Integer refStart) {
    this.refStart = refStart;
  }

  @Column(name = "ref_end")
  public Integer getRefEnd() {
    return refEnd;
  }

  public void setRefEnd(Integer refEnd) {
    this.refEnd = refEnd;
  }

  @Column(name = "query_start")
  public Integer getQueryStart() {
    return queryStart;
  }

  public void setQueryStart(Integer queryStart) {
    this.queryStart = queryStart;
  }

  @Column(name = "query_end")
  public Integer getQueryEnd() {
    return queryEnd;
  }

  public void setQueryEnd(Integer queryEnd) {
    this.queryEnd = queryEnd;
  }

  @Column(name = "job_group_id")
  public Long getJobGroupId() {
    return jobGroupId;
  }

  public void setJobGroupId(Long jobGroupId) {
    this.jobGroupId = jobGroupId;
  }

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "node_id")
  public Node getNode() {
    return node;
  }

  public void setNode(Node node) {
    this.node = node;
  }

  @Column(name = "data_file_path")
  public String getDataFilePath() {
    return dataFilePath;
  }

  public void setDataFilePath(String dataFilePath) {
    this.dataFilePath = dataFilePath;
  }
}
